package com.syl.upimg.config;

import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author syl
 * @create 2019-05-05 17:28
 **/
@Configuration
@ComponentScan({
    "com.syl.upimg.service"
})
public class BaseConfig {

    /**
     * 注册 RestTemplate
     * @return
     */
    @Bean
    @ConditionalOnMissingBean(RestTemplate.class)
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

}
